﻿using System.Collections.Generic;

namespace Configuration.ServerApi.Constant
{
    /// <summary>
    /// CommonConstant
    /// </summary>
    public static class CommonConstant
    {
        /// <summary>
        /// 用户默认账号密码
        /// </summary>
        public static string USER_DEFAULT_PASSWORD = "123456";

        /// <summary>
        /// 设备状态
        /// 0 或 1: 设备准备好待机 2: 设备运行中 3: 设备故障中 4: 设备离线中
        /// </summary>
        public static Dictionary<string, string> DeviceStatus = new Dictionary<string, string>()
        {
            { "0", "待机中" }, { "1", "待机中" }, { "2", "运行中" }, { "3", "故障中" }, { "4", "离线中" }
        };

        /// <summary>
        /// 转换任务类型Code为名称
        /// </summary>
        /// <param name="code">代码值</param>
        /// <returns>转换后的内容</returns>
        public static string ConvertFlowPathTypeToName(string code)
        {
            return code switch
            {
                "10" => "单任务",
                "20" => "平行任务",
                "30" => "迭代优化任务",
                _ => "单任务",
            };
        }

    }
}
